Skip to content

Conversation

@vy-ton
Copy link
Contributor

@vy-ton vy-ton commented May 29, 2025

No description provided.

@github-actions
Copy link
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/changelog/ @cloudflare/pm-changelogs, @cloudflare/pcx-cloudflare-one

@vy-ton
Copy link
Contributor Author

vy-ton commented May 29, 2025

@lambrospetrou @joshthoward can you review?

We do need to quantify the performance improvement. Doesn't have to be a graph, even just a ballpark % range

@github-actions
Copy link
Contributor

github-actions bot commented May 29, 2025


D1 query endpoints like `/query` and `/raw` have the most noticeable improvements since they no longer access Cloudflare's core data centers. D1 control plane endpoints such as those to create and delete databases see smaller improvements, since they still require access to Cloudflare's core data centers for other control plane metadata.

Performance improvements apply to only the REST API. Users can now expect similar performance querying their database via the REST API and via a [Worker](/d1/best-practices/query-d1/#query-d1-with-workers-binding-api).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also thought about mentioning comparison to the Worker binding API but they are still not quite the same. The REST API still does extra things, auth itself, we do some other internal calls, and so there is some overhead still until they are the same.

I would remove that sentence.

Suggested change
Performance improvements apply to only the REST API. Users can now expect similar performance querying their database via the REST API and via a [Worker](/d1/best-practices/query-d1/#query-d1-with-workers-binding-api).
These performance improvements only apply to the REST API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lambrospetrou Are there any plans to address the REST overhead? Is the overhead 10s of ms (if so I could still frame as comparable performance which is the goal)

Copy link
Contributor

@lambrospetrou lambrospetrou May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 100-300ms more than the Worker Binding depending on caching of downstream services, so not negligible in some cases. I don't want folks to start complaining that they don't see same numbers.

Copy link
Contributor Author

@vy-ton vy-ton May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 100-300ms more than the Worker Binding depending on caching of downstream services

is this specific to D1 or general REST overhead for CF APi?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's not general CF API. Well, auth is, but the rest is for other things we check in D1 (e.g. entitlements, feature flags, and others) only during REST API requests. We can reduce that further later with some followups.

@vy-ton vy-ton marked this pull request as ready for review May 29, 2025 17:45
@vy-ton vy-ton requested review from a team as code owners May 29, 2025 17:45
@vy-ton vy-ton merged commit e11060c into production May 30, 2025
10 checks passed
@vy-ton vy-ton deleted the d1-rest-changelog branch May 30, 2025 14:52
sdnts pushed a commit to sdnts/cloudflare-docs that referenced this pull request Jul 24, 2025
* D1 REST API latency changelog

---------

Co-authored-by: Lambros Petrou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants